package com.example.barcodeapp.ui.own.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import androidx.appcompat.widget.Toolbar;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.example.barcodeapp.R;
import com.example.barcodeapp.base.BaseActivity;
import com.example.barcodeapp.interfaces.IBasePersenter;
import com.example.barcodeapp.ui.own.bean.zhifufangshiBean;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.ButterKnife;

public class QueRenActivity extends BaseActivity {


    @BindView(R.id.iv_back_circle)
    ImageView ivBackCircle;
    @BindView(R.id.ff_back_contener)
    FrameLayout ffBackContener;
    @BindView(R.id.iv_back)
    ImageView ivBack;
    @BindView(R.id.tv_location)
    TextView tvLocation;
    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.ll_to_search)
    LinearLayout llToSearch;
    @BindView(R.id.right_iv)
    ImageView rightIv;
    @BindView(R.id.right_iv_two)
    ImageView rightIvTwo;
    @BindView(R.id.tv_rught_)
    TextView tvRught;
    @BindView(R.id.tv_right_two)
    TextView tvRightTwo;
    @BindView(R.id.toolBar)
    Toolbar toolBar;
    @BindView(R.id.linearLayout4)
    LinearLayout linearLayout4;
    @BindView(R.id.textView33)
    TextView textView33;
    @BindView(R.id.constraintLayout4)
    ConstraintLayout constraintLayout4;
    @BindView(R.id.textView34)
    TextView textView34;
    @BindView(R.id.zhifufangshhi)
    RecyclerView zhifufangshhi;
    @BindView(R.id.weixinzhifu)
    TextView weixinzhifu;

    @Override
    protected int getLayout() {
        return R.layout.activity_que_ren;
    }

    @Override
    protected void initView() {
        setToolBar(true, false, true, false, false);
        setTitle("季风音乐", R.color.black, R.color.white);
        weixinzhifu.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Toast.makeText(QueRenActivity.this, "调用微信支付", Toast.LENGTH_SHORT).show();
            }
        });
        zhifufangshhi.setLayoutManager(new LinearLayoutManager(this));
        ArrayList<zhifufangshiBean> list = new ArrayList<zhifufangshiBean>();
        list.add(new zhifufangshiBean(true, "微信支付", R.mipmap.wechat));
        list.add(new zhifufangshiBean(false, "支付宝支付", R.mipmap.alipay));
        list.add(new zhifufangshiBean(false, "余额支付", R.mipmap.jifengbitubiao));
        zhifufangshiAdapter zhifufangshiAdapter = new zhifufangshiAdapter(this, list);
        zhifufangshhi.setAdapter(zhifufangshiAdapter);
        zhifufangshiAdapter.setCallback(new zhifufangshiAdapter.IClick() {
            @Override
            public void click(int pos) {
                for (int i = 0; i < list.size(); i++) {
                    list.get(i).setFangshi(false);
                }
                list.get(pos).setFangshi(true);
                zhifufangshiAdapter.notifyDataSetChanged();
            }
        });
        zhifufangshiAdapter.notifyDataSetChanged();
    }

    @Override
    protected IBasePersenter initPersenter() {
        return null;
    }

    @Override
    protected void initData() {

    }
}